#!/bin/bash
####################################################################
# Prey Alarm Module Linux Functions
# URL: http://preyproject.com
# License: GPLv3
####################################################################

sound_alarm() {
	local player="mpg123"
	if [ -z `which $player` ]; then
		log "$player audio player not found!"
        local player="mediaplay"
        log "Checking for $player..."
        if [ -z `which $player` ]; then
		    log "$player audio player not found! Please install through your package manager."
		    return 1
        fi
	fi
	#run_as_current_user "pactl set-sink-mute 0 0"
	#run_as_current_user "pactl set-sink-volume 0 65536" # pump it up!
	run_as_current_user "$player $alarm__sound_file &> /dev/null" &
}
